<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta content="telephone=no,email=no" name="format-detection">
    <title>申请成为捎货人</title>
    <script type="text/javascript" src="/js/flexible.js?r=2016082215"></script>
    <link rel="stylesheet" href="/style/appHtmlStyle.css?r=2016092302" media="all"/>
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.1.0/jquery.min.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/fastclick/1.0.6/fastclick.min.js"></script>
</head>
<body class="exam">

<!-- 熟悉规则 -->
<section class="learn">
    <div class="title">
        <div class="fl">
            <span class="index"><b>1</b></span>
            <span>熟悉规则</span>
        </div>
    </div>
    <div class="chapter">
        <div class="item1<?php if($exam_status[1]==1){echo ' unlock';}else{echo ' lock-now';}?>">
            <div class="lock"></div>
            <div class="top-word">
                <h4>第一节</h4>
                <h5>捎货理念</h5>
            </div>
            <div class="bottom-img">
            </div>
        </div>
        <div class="item2<?php if($exam_status[2]==1){echo ' unlock';}elseif ($exam_status[1]==1){echo ' lock-now';}?>">
            <div class="lock"></div>
            <div class="top-word">
                <h4>第二节</h4>
                <h5>操作技能</h5>
            </div>
            <div class="bottom-img">
            </div>
        </div>
        <div class="item3<?php if($exam_status[3]==1){echo ' unlock';}elseif ($exam_status[2]==1){echo ' lock-now';}?>">
            <div class="lock"></div>
            <div class="top-word">
                <h4>第三节</h4>
                <h5>接单注意事项</h5>
            </div>
            <div class="bottom-img">
            </div>
        </div>
        <!--<div class="item4<?php /*if($exam_status[4]==1){echo ' unlock';}elseif ($exam_status[3]==1){echo ' lock-now';}*/?>">
            <div class="lock"></div>
            <div class="top-word">
                <h4>第四节</h4>
                <h5>开始考试</h5>
            </div>
            <div class="bottom-img">
            </div>
        </div>-->
        <p class="clear"></p>
    </div>
    <!--<div class="hr"></div>
    <div class="tip">
        <img src="/style/images/exam/tips-icon.png">
        <span>您也可以联系客服<a href="tel:400-181-3838">400-181-3838</a>，进行线下培训。</span>

    </div>-->
</section>
<!-- 提交资料 -->
<section class="apply">
    <div class="title" onclick="preJump2UploadInfo();">
        <div class="fl">
            <span class="index"><b>2</b></span>
            <span>提交资料</span>
        </div>
        <div class="fr">
            <a href="javascript:;"><?php echo $apply_status_words;?> &gt;</a>
        </div>
    </div>
</section>
<!-- 考试 -->
<section class="apply">
    <div class="title" onclick="JumpToExam();">
        <div class="fl">
            <span class="index"><b>3</b></span>
            <span>开始考试</span>
        </div>
        <div class="fr">
            <a href="javascript:;"><?php echo ($apply_status==2&&$exam_status[4]==1)?"考试通过":"未通过";?> &gt;</a>
        </div>
    </div>
</section>
<!-- 去接单 -->
<section class="shipper">
    <div class="title" onclick="preJump2ShippingList();">
        <div class="fl">
            <span class="index"><b>4</b></span>
            <span>审核和考试通过后即可接单</span>
        </div>
        <div class="fr">
            <a href="javascript:;">去接单 &gt;</a>
        </div>
    </div>
</section>
<script type="text/javascript">
    var uid = <?php echo $uid;?>;
    var apply_status = <?php echo $apply_status;?>;
    var exam_status4 = <?php echo $exam_status[4]?>;
    var preJump2ShippingList = function (){
        if (apply_status == 0) {
            tipsDialog('请先提交资料哦!');
            return;
        }
        if (apply_status == 1 || apply_status == 3) {
            tipsDialog('资料审核成功后才能继续下一步哦!');
            return;
        }
        if (exam_status4 != 1) {
            tipsDialog('请先完成在线学习考试哦!');
            return;
        }
        jump2ShippingList();
    };
    var preJump2UploadInfo = function(){
        if(apply_status == 3) {
            location.href='/api/exam/applyfail?uid='+uid;
            return;
        } else if (apply_status == 1){
            tipsDialog('资料审核中，客服会尽快联系你。');
        } else {
//            if (!$(".learn .chapter>div").hasClass("unlock") && !$(".learn .chapter>div").hasClass("lock-now")){
            if ($(".learn .chapter>div").hasClass("lock-now")){
                tipsDialog('请完成上一个步骤');
                return;
            }
            jump2UploadInfo(apply_status);//跳转至申请资料
        }
    }
    $(".learn .chapter>div").click(function(){
        if (!$(this).hasClass("unlock") && !$(this).hasClass("lock-now")) {
            /*if (apply_status == 0) {
                tipsDialog('请先提交资料哦!');
                return;
            }*/
            /*if (apply_status == 1 || apply_status == 3) {
                tipsDialog('资料审核成功后才能继续下一步哦!');
                return;
            }*/
            tipsDialog('请按顺序完成规则学习!');
            return;
        }
        if ($(this).hasClass("unlock") && $(this).index() == 3) {
            tipsDialog('已通过考试咯，无需再次考试!');
            return;
        }
        var index = $(this).index();
        location.href="/api/exam/chapter" + (index + 1) + '?uid=' + uid;
    });
    var JumpToExam = function(){
        if(apply_status == 1) {
            tipsDialog('资料审核中，客服会尽快联系你。');
            return;
        } else if(apply_status == 2) {
            if (exam_status4 == 1) {
                tipsDialog('已通过考试咯，无需再次考试!');
                return;
            }
            location.href='/api/exam/chapter4?uid='+uid;
            return;
        } else{
            tipsDialog('请完成上一个步骤');
            return;
        }

    }
</script>
<script type="text/javascript" src="/js/exam.js"></script>
</body>
</html>